import { http } from '@/utils/http'
import { post } from '@/utils/http'

// 费用列表(保养/维修/年检)
export const getAssetFeeList = (data: any) => {
  return http({
    method: 'POST',
    url: '/V5/carAssetFee/getCarAssetFeeByBusinesId',
    data,
  })
}

// 修改费用获取修改详情
export const getAssetFeeDetail = (data: any) => {
  return http({
    method: 'POST',
    url: '/V5/carAssetFee/getCarAssetFeeDetailDtoById',
    data,
  })
}

// 修改费用(保养、维修、年检)
export const updateAssetFee = (data: any) => {
  return http({
    method: 'POST',
    url: '/V5/carAssetFee/batchUpdateCarAssetFee',
    data,
  })
}

// 添加费用(保养/维修/年检)
export const addAssetFee = (data: any) => {
  return http({
    method: 'POST',
    url: '/V5/carAssetFee/batchAddCarAssetFee',
    data,
  })
}

// 去确认详情
export const getConfirmAssetFeeDetail = (data: any) => {
  return http({
    method: 'POST',
    url: '/V5/carAssetFee/toConfirm',
    data,
  })
}

// 确认费用
export const confirmAssetFee = (data: any) => {
  return http({
    method: 'POST',
    url: '/V5/carAssetFee/confirmCarAssetFee',
    data,
  })
}

// 违章 添加费用
export const violationAddFee = (data: any) => {
  return http({
    method: 'POST',
    url: '/V5/violation/fee/add',
    data,
  })
}

// 违章 修改费用
export const violationEditFee = (data: any) => {
  return http({
    method: 'POST',
    url: '/V5/violation/fee/edit',
    data,
  })
}

// 违章 确认费用
export const violationConfirmFee = (data: any) => {
  return http({
    method: 'POST',
    url: '/V5/violation/fee/confirm',
    data,
  })
}

// 违章 获取进入确认费用页面数据
export const violationToConfirmFee = (data: any) => {
  return http({
    method: 'POST',
    url: '/V5/violation/fee/toConfirm',
    data,
  })
}

// 违章 获取费用详情
export const violationFeeDetail = (data: any) => {
  return http({
    method: 'POST',
    url: '/V5/violation/fee/info',
    data,
  })
}

// 车辆费用详情(购置费)
export const getPurchaseFeeDetail = (data: any) => {
  return http({
    method: 'POST',
    url: '/V5/carAssetFee/purchaseFeeDetails',
    data,
  })
}

// 合并确认验证
export const checkConfirm = (data: any) => {
  return http({
    method: 'POST',
    url: '/V5/carAssetFee/checkManyToConfirm',
    data,
  })
}

// 添加/修改车辆购置费-其他费用
export const addOrUpdatePurchaseFee = (data: any) => {
  return http({
    method: 'POST',
    url: '/V5/carAssetFee/addOtherFee',
    data,
  })
}

// 修改账单计划
export const updateAssetFeePlan = (data: any) => {
  return http({
    method: 'POST',
    url: '/V5/czsContractCarPurchase/editPurchaseBillInfo',
    data,
  })
}

/**
 * @description: 借调管理  修改费用 - 保存【借出】
 * @param data
 * @return Promise
 */
export const editFeeDetailForType2 = (data: any) => {
  return http({
    method: 'POST',
    url: '/V5/czsContractCarPeerShunting/editPurchaseBillInfo',
    data,
  })
}

// 获取费用详情(不分期)
export const getPurchaseFeeDetailNoStage = (data: any) => {
  return http({
    method: 'POST',
    url: '/V5/carAssetFee/getUpdateFeeDetail',
    data,
  })
}

// 修改费用详情(不分期)
export const updatePurchaseFeeDetailNoStage = (data: any) => {
  return http({
    method: 'POST',
    url: '/V5/carAssetFee/updatePurchaseFee',
    data,
  })
}

// 短租合并费用前确认
export const checkManyToConfirm = (data: any) => {
  return http({
    method: 'POST',
    url: '/V5/orderFee/checkManyToConfirm',
    data,
  })
}

// 长租合并费用前确认
export const checkManyToConfirmLOrder = (data: any) => {
  return http({
    method: 'POST',
    url: '/V5/czsOrderFee/checkManyToConfirm',
    data,
  })
}
// 确认结算V6
export const orderFeeConfirmFee = (data: any) => {
  return http({
    method: 'POST',
    url: '/V6/orderFee/confirmFee',
    data,
  })
}

/**
 * @description: 借调管理 添加费用
 * @param data
 * @return Promise
 */
export const addFee = (data) => post({ url: '/V5/carSeconded/feeAdd', data })

// 获取押金订单列表
export const getDepositOrderList = (data: any) => {
  return http({
    method: 'POST',
    url: '/V5/sOrderDeposit/getUsableAmountOrderList',
    data,
  })
}
